/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.devel.designpatterns.composite;

import com.devel.designpatterns.visitor.Visitor;

/**
 *
 * @author wm.devel
 */
public class Leaf extends Component {
    
    private String text;

    public Leaf(String text) {
        this.text = text;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    @Override
    public String toString() {
        return "Leaf: " + text;
    }

    @Override
    public void accept(Visitor v) {
        v.visitLeaf(this);
    }
}
